<link type="text/css" href="<?php echo base_url();?>assets/js/development-bundle/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo base_url();?>assets/js/development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/development-bundle/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/development-bundle/ui/jquery.ui.widget.js"></script>
<script language="javascript">
	function back(){
		document.location="<?php echo site_url(); ?>/master_mahasiswa";
	}
	$(document).ready(function(){
		$(".tgl").datepicker({
			changeMonth: true,
			changeYear: true,
			monthNamesShort: [ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "Nopember", "Desember" ],
			dayNames: [ "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" ],
			dayNamesMin: [ "M", "S", "S", "R", "K", "J", "S" ],
			// showOn: "button",
			dateFormat:"dd-mm-yy",
			// buttonImage: "<?php echo base_url(); ?>assets/images/calendar.gif",
			buttonImageOnly: true
		});
	});
</script>
<?php
echo form_open("/master_mahasiswa/form_mahasiswa/".$parameter, array("name"=>"form_mahasiswa","id"=>"medic_form"));
if($parameter == FALSE){
	$kelas	= set_value("kelas");
	// $dosen	= set_value("dosen");
	$nrp	= set_value("nrp");
	$nama	= set_value("nama");
	$alamat	= set_value("alamat");
	// $no_telp= set_value("no_telp");
	$tgl_masuk	= set_value("tgl_masuk");
	$semester	= set_value("semester");
	$tgl_lulus	= set_value("tgl_lulus");
	$status	= set_value("status");
	// $angkatan	= set_value("angkatan");
} else {
	$kelas	= $value["ID_KELAS"];
	$nrp	= $value["NRP"];
	$nama	= $value["NAMA"];
	$alamat	= $value["ALAMAT"];
	// $no_telp= $value["NO_TELP"];
	$tgl_masuk	= $value["TGLMASUK"];
	$semester	= $value["KELAS"];
	$tgl_lulus	= $value["TGLLULUS"];
	$status	= $value["STATUS"];
	// $angkatan	= $value["ANGKATAN"];
}
?>
<p>
	<label>NRP</label>
	<input type="text" name="nrp" value="<?php echo $nrp; ?>">
	<?php echo form_error("nrp"); ?>
</p>
<p id="role">
	<label>Nama Kelas</label>
	<select name="kelas">
		<option value="">-- Nama Kelas --</option>
		<?php
		foreach($qkelas as $row){
		?>
		<option value="<?php echo $row["ID_KELAS"]; ?>" <?php echo ($kelas == $row["ID_KELAS"]) ? ("selected") : (""); ?>><?php echo $row["NAMA_PROGRAM"] . " " . $row["NAMA_JURUSAN"] . " " . $row["NAMA_KELAS"]; ?></option>
		<?php
		}
		?>
	</select>
	<?php echo form_error("kelas"); ?>
</p>
<p>
	<label>Nama Mahasiswa</label>
	<input type="text" name="nama" value="<?php echo $nama; ?>">
	<?php echo form_error("nama"); ?>
</p>
<p>
	<label>Alamat</label>
	<textarea name="alamat"><?php echo $alamat; ?></textarea>
	<?php echo form_error("alamat"); ?>
</p>
<!--<p>
	<label>Nomor Telepon</label>
	<input type="text" name="no_telp" value="<?//php echo $no_telp; ?>">
	<?//php echo form_error("no_telp"); ?>
</p>-->
<p>
	<label>Tanggal Masuk</label>
	<input type="text" name="tgl_masuk" value="<?php echo ($tgl_masuk == NULL || $tgl_masuk == "0000-00-00") ? (NULL) : (date("d-m-Y",strtotime($tgl_masuk))); ?>" class="tgl">
	<?php echo form_error("tgl_masuk"); ?>
</p>
<p>
	<label>Semester</label>
	<input type="text" name="semester" value="<?php echo $semester; ?>">
	<?php echo form_error("semester"); ?>
</p>
<p>
	<label>Tanggal Lulus</label>
	<input type="text" name="tgl_lulus" value="<?php echo ($tgl_lulus == NULL || $tgl_lulus == "0000-00-00") ? (NULL) : (date("d-m-Y",strtotime($tgl_lulus))); ?>" class="tgl">
	<?php echo form_error("tgl_lulus"); ?>
</p>
<!--<p>
	<label>Angkatan</label>
	<input type="text" name="angkatan" value="<?//php echo $angkatan; ?>">
	<?//php echo form_error("angkatan"); ?>
</p>-->
<p>
	<label>Status</label>
	<select name="status">
		<option value="">-- Pilih Status --</option>
		<option value="0" <?php echo ($status == 0) ? ("selected") : (""); ?>>Belum Lulus</option>
		<option value="1" <?php echo ($status == 1) ? ("selected") : (""); ?>>Lulus</option>
		<option value="2" <?php echo ($status == 2) ? ("selected") : (""); ?>>DO</option>
		<option value="3" <?php echo ($status == 3) ? ("selected") : (""); ?>>Cuti</option>
	</select>
	<?php echo form_error("status"); ?>
</p>
<p>
	<input type="submit" class="btn btn-primary" id="submit" value="Simpan">
	<input type="reset" class="btn btn-primary" id="submit" value="Reset">
	<input type="button" class="btn btn-primary" id="submit" value="Kembali" onClick="back()">
</p>
<?php echo form_close(); ?>